var express = require('express');
var router = express.Router();
var userDao = require('../dao/userDao');
var qiniu = require('../dao/qiniuDao');
var testController=require('../util/muilterControlle');
router.post('/image',testController.dataInput);
var token = require('../util/tokenUtil.js');

/* GET users listing. */
router.get('/', function(req, res, next) {
  $token(req, res, next)
});
router.use('/list',token.verifyToken,function(req, res, next) {
  userDao.list(req, res, next);
});
router.use('/update',token.verifyToken,function(req, res, next) {
    userDao.update(req, res, next);
});
router.use('/token',token.verifyToken,function(req, res, next) {
    qiniu.token(req, res, next);
});

router.use('/image', function(req, res, next) {
  userDao.addImage(req, res, next);
});

router.get('/addUser', function(req, res, next) {
  userDao.add(req, res, next);
});
router.use('/login', function(req, res, next) {
  userDao.login(req, res, next);
});



module.exports = router;
